import requests
from bs4 import BeautifulSoup

class CodeMarket:
    def __init__(self):
        self.URL = 'http://www.landchina.com/default.aspx'
        #self.header = { 'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36'}
        self.header = { 'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36' }

    def get_project(self):
        #page = str(page)
        #html = requests.get(self.URL, params={'page': page}, headers = self.header)
        #currentPage=1&pageSize=100
        html = requests.get(self.URL, params={"tabid" : "226" }, headers = self.header)

        #html.content.decode("utf-8")
        print(html.text)

        #soup = BeautifulSoup(html.text, "html.parser")
        #print(soup.get_text())
        #name = soup.select('#pane-project > div > div > div > div.main__left > div:nth-child(3) > div > div:nth-child(1) > div > div > div.el-col.el-col-19 > div.col-row > span.title > a')
        #name = soup.select(' #container > div > div > div > div > div > div.left-container-1dwXK > div.list-container--j7Ng > div > div > div:nth-child(3) >  div > div.body-content-2y6ks > div > div.title-2q5sH > a > span.name-UUeBS > span')

        #print(soup)

        #for name in name:
        #    print(name.get_text())

        #print(name.__len__())

if __name__ == "__main__":
    cls = CodeMarket()
    cls.get_project()